﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using System.Collections;

namespace SchemaMonitor.json
{
    [DataContract]
    public class CFieldBool : CField
    {
        //Members
        [DataMember(Order = 1)]
        public List<bool> Bools;

        //Constructor
        public CFieldBool(CNodeBasic parent, CTag tag, object value) : base(parent, tag)
        {
            this.Value = value;
        }

        //Serialisation Constructors
        private CFieldBool() { }
        static CFieldBool() { ProtoBuf.Serializer.PrepareSerializer<CFieldBool>(); }

        //Must Override
        public    override IList List { get { return Bools; } set { Bools = value.Cast<bool>().ToList(); } }
        protected override IList InitList()                 { return new List<bool>(); }
        protected override IList InitList(object[] array)   { return array.Cast<bool>().ToList(); }
    }
}
